# -*- encoding: utf-8 -*-
'''
@File    :   8.py
@Time    :   2022/11/09 12:43:50
@Author  :   Cms 
@Version :   1.0
@Contact :   2267000140@qq.com
@WebSite    :   www.baidu.com
'''

# here put the import lib

# 8  请用Python定义一个函数，给定一个字符串，找出该字符串中出现次数最多的那个字符，并打印出该字符及其出现的次数。
#  例如，输入 aaaabbc，输出：a:4

def myfunc(arg1):
    dict1 = {}
    for i in arg1:
        if(i in dict1):
            dict1[i] += 1
        else:
            dict1[i] = 1
    maxvalue = max(dict1.values())

    for i in dict1:
        if(dict1[i] == maxvalue):
            print(i,":",dict1[i])

str1 = "abca"

myfunc(str1)